<template>
  <div class="gj-common" :class="newclass" v-if="con">
    <div class="box clearfix">
      <div class="gj-tit4">{{con.title}}</div>
      <div class="box1 ov">
        <div class="top">
          <div class="tit">{{con.top_tit}}</div>
          <div class="remark">{{con.top_remark}}</div>
        </div>
        <div class="con flex-bect">
          <div class="le">
            <div v-for="item in con.tiaojian" :key="item.id" class="item">
              <span class="lab">{{item.lab}}</span>
              <div class="sp" v-html="item.text"></div>
            </div>
          </div>
          <div class="ri">
            <div class="bg-tit">{{con.ri_tit}}</div>
            <div class="tab">
              <div v-for="(item, index) in con.school" :key="item.id" class="item" :class="{on : sIdx == index}" @mouseenter="getIdx(item.id)">{{item.area}}</div>
            </div>
            <div class="div flex-lect" v-if="sIdx > -1">
              <a v-for="item in con.school[sIdx].list" :key="item.id" :href="xxpath" class="item">{{item.name}}</a>
            </div>
          </div>
        </div>
      </div>
      <div class="box2 clearfix">
        <div class="tit"><span class="lab">{{con.w_tit_lab}}</span>{{con.w_tit}}</div>
        <div class="list">
          <div v-for="item in con.w_list" :key="item.id" class="item flex-bect">
            <div class="ico">Q</div>
            <div class="flex1"><div class="w row1">{{item.w}}</div></div>
            <div class="h row2">{{item.h}} <a :href="wpath" class="more">查看详情>></a></div>
          </div>
        </div>
      </div>
    </div>
  </div>
      
</template>

<script>
// 不支持 import
module.exports = {
  props:{
    con:null,
    newclass:"",
    router:{},
    wpath:{
      type:String,
      default:""
    },
    xxpath:{
      type:String,
      default:""
    }
  },
  data: function () {
    return {
      sIdx:-1
    };
  },
  components: {},
  watch:{
    con(n, o){
      console.log('111',n.area_id)
      if(n){
        this.getIdx(n.area_id)
      }
    }
  },
  mounted(){
    if(this.con){
      this.getIdx(this.con.area_id)
    }
  },
  methods:{
    getIdx(e){
      this.sIdx = this.con.school.findIndex(n => n.id == e)
    },
  }
};
</script>

<style>

</style>